Skip to content

Conversation

@yuvmen
Copy link
Member

@yuvmen yuvmen commented Sep 29, 2025

Transfomers is used for tokenization of strings. While we do currently import titoken as well, we want to use transformers to count tokens the same way Seer does in Sentry for stacktrace token counts.
We could consider converting usages of titoken to transformers to maintain a dependency on only one
tokenization package, but for now we will have them both.

Transfomers is used for tokenization of strings. While we do currently import `titoken` as well, we want
to use `transformers` to count tokens the same way Seer does in Sentry for stacktrace token counts.
 We could consider converting usages of `titoken` to `transformers` to maintain a dependency on only one
 tokenization package, but for now we will have them both.
Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for many reasons we've decided not to add numpy and friends to the main sentry monorepo, if we want to re-evaluate this we should consider broader architecture changes (the whole reason seer exists is because we couldn't put numpy in the sentry monorepo)

@yuvmen
Copy link
Member Author

yuvmen commented Sep 29, 2025

@JoshFerge I see, thanks for the context, funny I had no idea that was the motivation for it - closing this, I am going to convert to importing only the tokenizers part as suggested by @kddubey in another PR. It does not depend on numpy, I wonder if it is lean enough to be able to be used, ill open the PR and we can see.

@yuvmen yuvmen closed this Sep 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants